#ifndef game_base_msg_h
#define game_base_msg_h
#include <stdio.h>
#include <vector>
#include <string>
using namespace std;
class JMsgWriter;
class JMsgReader;
class JMsgProto;
enum game_base_msgTypeIds {
   kBaseMsgC2SActivate = 3,
   kBaseMsgC2SCreateFriendDesk = 21,
   kBaseMsgC2SGetPlayerInfo = 19,
   kBaseMsgC2SJoinDesk = 9,
   kBaseMsgC2SJoinFriendDesk = 23,
   kBaseMsgC2SJoinRoom = 7,
   kBaseMsgC2SLeaveDesk = 11,
   kBaseMsgC2SLeaveRoom = 26,
   kBaseMsgC2SLogin = 5,
   kBaseMsgC2SRegister = 1,
   kBaseMsgC2SUpdatePlayerData = 27,
   kBaseMsgC2SUpdateRoomStatus = 24,
   kBaseMsgPlayerInfo = 18,
   kBaseMsgDeskS2COtherPlayerJoinDesk = 16,
   kBaseMsgDeskS2COtherPlayerLeaveDesk = 17,
   kBaseMsgRoomS2COtherPlayerJoinDesk = 14,
   kBaseMsgRoomS2COtherPlayerLeaveDesk = 15,
   kBaseMsgS2CActivate = 4,
   kBaseMsgS2CCreateFriendDesk = 22,
   kBaseMsgS2CGetPlayerInfo = 20,
   kBaseProtoDeskInfo = 81,
   kBaseMsgS2CJoinDesk = 10,
   kBaseProtoRoomState = 82,
   kBaseMsgS2CJoinRoom = 8,
   kBaseMsgS2CLogin = 6,
   kBaseMsgS2COtherPlayerJoinRoom = 12,
   kBaseMsgS2COtherPlayerLeaveRoom = 13,
   kBaseMsgS2CRegister = 2,
   kBaseMsgS2CUpdatePlayerInfo = 28,
   kBaseMsgS2CUpdateRoomStatus = 25,
};

JMsgProto* game_base_msgCreateProto();
struct BaseMsgC2SActivate {
   BaseMsgC2SActivate();
   string guestUserName;
   string userName;
   string passwordSha1;
   string phoneNo;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgC2SCreateFriendDesk {
   BaseMsgC2SCreateFriendDesk();
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgC2SGetPlayerInfo {
   BaseMsgC2SGetPlayerInfo();
   string userName;
   bool needGameData;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgC2SJoinDesk {
   BaseMsgC2SJoinDesk();
   int deskId;
   int chairId;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgC2SJoinFriendDesk {
   BaseMsgC2SJoinFriendDesk();
   string deskCode;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgC2SJoinRoom {
   BaseMsgC2SJoinRoom();
   int roomId;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgC2SLeaveDesk {
   BaseMsgC2SLeaveDesk();
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgC2SLeaveRoom {
   BaseMsgC2SLeaveRoom();
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgC2SLogin {
   BaseMsgC2SLogin();
   string userName;
   string password;
   string gameName;
   bool isGuest;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgC2SRegister {
   BaseMsgC2SRegister();
   string userName;
   string passwordSha1;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgC2SUpdatePlayerData {
   BaseMsgC2SUpdatePlayerData();
   string nickName;
   string phoneNo;
   int avatorId;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgC2SUpdateRoomStatus {
   BaseMsgC2SUpdateRoomStatus();
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgPlayerInfo {
   BaseMsgPlayerInfo();
   string userName;
   bool isGuest;
   string nickName;
   int avatarId;
   int playerId;
   string gameData;
   int score;
   string phoneNo;
   string lastLoginTime;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgDeskS2COtherPlayerJoinDesk {
   BaseMsgDeskS2COtherPlayerJoinDesk();
   BaseMsgPlayerInfo playerInfo;
   int deskId;
   int chairId;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgDeskS2COtherPlayerLeaveDesk {
   BaseMsgDeskS2COtherPlayerLeaveDesk();
   string userName;
   int deskId;
   int chairId;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgRoomS2COtherPlayerJoinDesk {
   BaseMsgRoomS2COtherPlayerJoinDesk();
   int deskId;
   int chairId;
   string userName;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgRoomS2COtherPlayerLeaveDesk {
   BaseMsgRoomS2COtherPlayerLeaveDesk();
   int deskId;
   int chairId;
   string userName;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgS2CActivate {
   BaseMsgS2CActivate();
   bool isSuccess;
   int errorCode;
   string newUserName;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgS2CCreateFriendDesk {
   BaseMsgS2CCreateFriendDesk();
   bool success;
   int errorCode;
   int deskId;
   string deskCode;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgS2CGetPlayerInfo {
   BaseMsgS2CGetPlayerInfo();
   int isSuccess;
   int errorCode;
   BaseMsgPlayerInfo playerInfo;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseProtoDeskInfo {
   BaseProtoDeskInfo();
   int deskId;
   std::vector<BaseMsgPlayerInfo> playerNames;
   std::vector<int> playerChairIds;
   string deskCode;
   bool isFriend;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgS2CJoinDesk {
   BaseMsgS2CJoinDesk();
   bool success;
   int chairId;
   BaseProtoDeskInfo deskInfo;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseProtoRoomState {
   BaseProtoRoomState();
   int roomId;
   int maxPlayerCount;
   int currentPlayerCount;
   string serverAddr;
   int roomType;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgS2CJoinRoom {
   BaseMsgS2CJoinRoom();
   bool isSuccess;
   int errorCode;
   int roomId;
   std::vector<BaseProtoDeskInfo> desks;
   int allDeskCount;
   std::vector<BaseMsgPlayerInfo> players;
   BaseProtoRoomState roomState;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgS2CLogin {
   BaseMsgS2CLogin();
   int success;
   int errorCode;
   string userName;
   BaseMsgPlayerInfo playerInfo;
   string playerGameData;
   std::vector<BaseProtoRoomState> rooms;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgS2COtherPlayerJoinRoom {
   BaseMsgS2COtherPlayerJoinRoom();
   BaseMsgPlayerInfo playerInfo;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgS2COtherPlayerLeaveRoom {
   BaseMsgS2COtherPlayerLeaveRoom();
   string userName;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgS2CRegister {
   BaseMsgS2CRegister();
   string userName;
   bool isSuccess;
   int errorCode;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgS2CUpdatePlayerInfo {
   BaseMsgS2CUpdatePlayerInfo();
   bool success;
   string userName;
   string nickName;
   string phoneNo;
   int avatorId;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
struct BaseMsgS2CUpdateRoomStatus {
   BaseMsgS2CUpdateRoomStatus();
   bool success;
   BaseProtoRoomState roomStatus;
   void encode(JMsgProto* proto, JMsgWriter* writer);
   bool decode(JMsgProto* proto, JMsgReader* reader);
};
#endif
